<%@page import="com.java.model.MusicInfo"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.java.bean.MusicBean"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="icon" href="./icon/ico.ico">
<link href="./css/bootstrap.min.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>个人管理</title>
</head>
<%
	String pages = "1";
	if (request.getParameter("page") != null) {
		pages = request.getParameter("page");
	}
	System.out.println(pages);
	int pagesI = Integer.valueOf(pages);
	MusicBean musicBean = new MusicBean();
	String id = null;
	Cookie[] cookies = request.getCookies();
	for (Cookie cookie : cookies) {
		if (cookie.getName().equals("id")) {
			id = cookie.getValue();
		}
	}
	ArrayList<MusicInfo> list = new ArrayList<MusicInfo>();
	list = musicBean.getList("download", id,
			String.valueOf(pagesI * 10 - 10),
			String.valueOf(pagesI * 10));
%>
<body>
	上传记录

	<table class="table table-hover" border="0sp" width="100%">
		<tr align="center">
			<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
				ID</th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
				名字</th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
				演唱者</th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
				下载次数</th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
				播放次数</th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="5%">
				播放</th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="5%">
				下载</th>
		</tr>
		<%
			for (int i = 0; i < list.size(); i++) {
		%>
		<tr align="center">
			<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
				<%=(i + 1)%></th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
				<%=(list.get(i).getName())%></th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="30%">
				<%=list.get(i).getPlayer()%></th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
				<%=list.get(i).getDownload()%></th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="10%">
				<%=list.get(i).getPlay()%></th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="5%"><a
				href="play.jsp?id=<%=list.get(i).getId()%>"><img alt="text"
					src="./icon/play.ico" width="30sp" height="30sp"> </a></th>
			<th colspan="1" rowspan="1" headers="" scope="col" width="5%"><a
				href="download.jsp?id=<%=list.get(i).getId()%>"> <img alt="text"
					src="./icon/download.ico" width="30sp" height="30sp">
			</a></th>
		</tr>
		<%
			}
		%>
	</table>
	<ul class="pager">
		<%
			if (pagesI != 1) {
		%>
		<li><a href="musiclist.jsp?page=<%=(pagesI - 1)%>">上一页</a></li>
		<%
			} else {
		%>
		<li class="previous disabled">上一页</li>
		<%
			}
		%>
		<li><%=pagesI%></li>
		<%
			if (list.size() == 10) {
		%>
		<li><a href="musiclist.jsp?page=<%=(pagesI + 1)%>">下一页</a></li>
		<%
			} else {
		%>
		<li class="next disabled">下一页</li>
		<%
			}
		%>
	</ul>

</body>
</html>